package com.genshang.restaurant.controller;


import com.genshang.restaurant.result.ResultBody;
import com.genshang.restaurant.service.IConsumptionlistService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author Alex
 * @since 2020-09-26
 */
@RestController
@RequestMapping("/consumptionlist")
public class ConsumptionlistController {

    @Autowired
    private IConsumptionlistService consumptionlistService;

    /**
     * 2.2 消费并兑换积分
     *
     * @param nickname
     * @param shopId
     * @param consumerId
     * @param finalPrice
     * @return
     */
    @GetMapping("/consume")
    public ResultBody consume(String nickname, String shopId, String consumerId, String finalPrice) {
        return consumptionlistService.consume(nickname, shopId, consumerId, finalPrice);
    }

    @GetMapping("/getList")
    public ResultBody getList(Long pageSize, Long currentPage, String shopId, String personNumber, String minPrice, String maxPrice) {
        return consumptionlistService.getList(pageSize, currentPage, shopId, personNumber, minPrice, maxPrice);
    }

}
